<template>
	<el-drawer title="合同详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="关联人员" prop="userId">{{form.userName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="合同编号" prop="contractCode">{{form.contractCode}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="合同类型" prop="contractType">{{form.contractTypeName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="签约方式" prop="signType">{{form.signTypeName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="签约公司" prop="enterprise">{{form.enterprise}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="应聘岗位" prop="workJob">{{form.workJobName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="合同生效时间" prop="startTime">{{form.startTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="合同终止时间" prop="endTime">{{form.endTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="合同期限属性" prop="specialization">{{form.specializationTypeName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="合同签订时间" prop="signTime">{{form.signTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="合同备注">{{form.remark}}
					</el-form-item>
					<el-form-item label="合同附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true" ></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				contractId:'',
				contractCode: '',
				userName: '',
				contractTypeName: '',
				signTypeName:'',
				enterprise:'',
				workJobName:'',
				startTime: '',
				endTime: '',
				specializationTypeName:'',
				signTime:'',
				attachId:'',
				remark:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.contractId = data.contractId
			this.form.contractCode = data.contractCode
			this.form.userName = data.userName
			this.form.contractTypeName = data.contractTypeName
			this.form.signTypeName = data.signTypeName
			this.form.enterprise = data.enterprise
			this.form.workJobName = data.workJobName
			this.form.startTime = data.startTime
			this.form.endTime = data.endTime
			this.form.specializationTypeName = data.specializationTypeName
			this.form.signTime = data.signTime
			this.form.attachId = data.attachId
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
</style>
